#!/bin/bash

# 检查telnet-server是否已安装
if rpm -q telnet-server; then
    echo "[-] 检测失败: telnet-server已安装"
    
    # 显示已安装的telnet相关包
    echo "    已安装的telnet相关包:"
    rpm -qa | grep telnet | sed 's/^/    /'
    
    # 检查服务状态
    if systemctl is-active telnet.socket >/dev/null 2>&1; then
        echo "    telnet.socket服务正在运行"
    fi
    
    exit 1
else
    echo "[+] 检测通过: telnet-server未安装"
    exit 0
fi

